{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<div style=\"text-align: center;\">\t\n",
    "\n",
    "# Lecture 3: Conditional Probability and Bayes rule \n",
    "## Instructor： 胡传鹏（博士）[Dr. Hu Chuan-Peng]\n",
    "### 南京师范大学心理学院[School of Psychology, Nanjing Normal University]\n",
    " \n",
    "## Part 2: Parameters (模型参数)\n",
    "\t\n",
    "</div>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "### 概率质量函数 (Probability Mass Function, PMF)\n",
    "\n",
    "离散随机变量X的概率质量函数被定义为随机变量呈现特定值的概率。\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "$$ p(x_k)=P[X=x_k] $$\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 概率密度函数 (Probability Density Function, PDF)\n",
    "\n",
    "随机变量的取值落在某个区域之内的概率则为概率密度函数在这个区域上的积分"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "$$ f(x)=\\sum_{k}^{}p(x_k)\\delta(x-x_k)  $$\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 离散概率分布"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 伯努利分布(Bernoulli distribution)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "假设一个事件只有发生或者不发生两种可能，并且这两种可能是固定不变的。那么，如果假设它发生的概率是$p$，那么它不发生的概率就是$q = 1-p$。\n",
    "\n",
    "\n",
    "伯努利实验就是做一次服从伯努利概率分布的事件，它发生的可能性是$p$，不发生的可能性是$1-p$。"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    " $$ f(k,p) = p^{k}(1-p)^{1-k} $$\n",
    "\n",
    " for $k \\in {0, 1} $ $k$ 为可能的结果"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "如何在Python中观察这种分布？"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "ename": "ModuleNotFoundError",
     "evalue": "No module named 'numpy'",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mModuleNotFoundError\u001b[0m                       Traceback (most recent call last)",
      "\u001b[1;32m/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/2022NNU_Bayesian/Notebooks/Lecture3_pt2.ipynb Cell 11\u001b[0m in \u001b[0;36m<cell line: 1>\u001b[0;34m()\u001b[0m\n\u001b[0;32m----> <a href='vscode-notebook-cell:/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/2022NNU_Bayesian/Notebooks/Lecture3_pt2.ipynb#X14sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39mnumpy\u001b[39;00m \u001b[39mas\u001b[39;00m \u001b[39mnp\u001b[39;00m\n\u001b[1;32m      <a href='vscode-notebook-cell:/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/2022NNU_Bayesian/Notebooks/Lecture3_pt2.ipynb#X14sZmlsZQ%3D%3D?line=1'>2</a>\u001b[0m \u001b[39mimport\u001b[39;00m \u001b[39mmatplotlib\u001b[39;00m\u001b[39m.\u001b[39;00m\u001b[39mpyplot\u001b[39;00m \u001b[39mas\u001b[39;00m \u001b[39mplt\u001b[39;00m\n\u001b[1;32m      <a href='vscode-notebook-cell:/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/2022NNU_Bayesian/Notebooks/Lecture3_pt2.ipynb#X14sZmlsZQ%3D%3D?line=3'>4</a>\u001b[0m \u001b[39m#从scipy.stats模块加载二项分布、伯努利分布、正态分布、超几何分布、泊松分布、t分布模块\u001b[39;00m\n",
      "\u001b[0;31mModuleNotFoundError\u001b[0m: No module named 'numpy'"
     ]
    }
   ],
   "source": [
    "import numpy as np\n",
    "import matplotlib.pyplot as plt\n",
    "\n",
    "#从scipy.stats模块加载二项分布、伯努利分布、正态分布、超几何分布、泊松分布、t分布模块\n",
    "from scipy.stats import binom, bernoulli,norm,hypergeom,poisson,t\n",
    "#从scipy包加载stats模块\n",
    "from scipy import stats"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAQkklEQVR4nO3df6hfd33H8eerCVno0qk0V5AkbWKXsgUVdXe160DbqSN1kAz8QQIyC53BdtlkHWEVRyvxLxOmsJF2ZpvMDVysZcgdRsKmFZkYl+vsqmmpu43VppP1ttaOIrFmvvfH91v5enuT70lz7r25nzwf8OV7zufzud/z/uR77yvnnvM996SqkCQtf5csdQGSpH4Y6JLUCANdkhphoEtSIwx0SWrEyqXa8Nq1a2vjxo1LtXlJWpa+/vWvP1lVE/P1LVmgb9y4kenp6aXavCQtS0m+e6Y+D7lIUiMMdElqhIEuSY0w0CWpEcsm0J99Fu68EyYm4JJLBs933jlolyR1DPQkW5M8nGQmye3z9H8syf3Dx7eT/LDPIp99Fq69FvbtgyefhKrB8759g3ZDXZI6BHqSFcAB4EZgC7AzyZbRMVX1x1X12qp6LfCXwD/1WeT+/fDII3Dq1M+3nzo1aN+/v8+tSdLy1GUP/RpgpqpOVNVzwCFg+1nG7wT+sY/innfXXS8M8+edOgV3393n1iRpeeoS6OuAx0bWTw7bXiDJlcAm4Itn6N+VZDrJ9OzsbOcin3rq/Pol6WLQ90nRHcC9VfV/83VW1cGqmqyqyYmJea9cndfll59fvyRdDLoE+uPAhpH19cO2+eyg58MtALfeCqtXz9+3ejXcckvfW5S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Q5zJduDva+Ao8NIkrzifbV7IgT7fzanXnWlMVZ0Gnr859XLVZc6jbmbwP/xyNnbOw19FN1TV5xazsAXU5X2+Grg6yVeSHE2yddGqWxhd5vwh4N1JTjK4/8IfLk5pS+Zcf97HWtSbRKs/Sd4NTAJvWupaFlKSS4CPAjctcSmLbSWDwy7XM/gt7MtJXl1VP1zKohbYTuDvqurPk/wGg7ugvaqqfrrUhS0XF/Ie+sV4c+oucybJW4APAtuq6seLVNtCGTfny4BXAV9K8iiDY41Ty/zEaJf3+SQwVVU/qarvAN9mEPDLVZc53wzcA1BVXwVWM/gjVq3q9PN+Li7kQL8Yb049ds5JXgd8nEGYL/fjqjBmzlX1TFWtraqNVbWRwXmDbVU1vTTl9qLL9/ZnGeydk2Qtg0MwJxaxxr51mfP3gDcDJPlVBoE+u6hVLq4p4PeGn3a5Fnimqr5/Xq+41GeCx5wlfhuDPZNHgA8O2/Yy+IGGwRv+GWAG+HfglUtd8yLM+V+B/wHuHz6mlrrmhZ7znLFfYpl/yqXj+xwGh5oeBL4J7FjqmhdhzluArzD4BMz9wG8vdc3nOd9/BL4P/ITBb1w3A+8D3jfyHh8Y/nt8s4/vay/9l6RGXMiHXCRJ58BAl6RGGOiS1AgDXZIaYaBLUiMMdElqhIEuSY34f+uY1bHHQn6IAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(1, 1)\n",
    "\n",
    "p = 0.3\n",
    "\n",
    "# 在参数为0.3的情况下，伯努利分布的平均值m、方差v、峰度s和偏度k\n",
    "mean, var, skew, kurt = bernoulli.stats(p, moments='mvsk') \n",
    "\n",
    "x1 = bernoulli.ppf(0.01, p)\n",
    "x2 = bernoulli.ppf(0.99, p)\n",
    "\n",
    "ax.plot(x1, bernoulli.pmf(x1, p), 'bo', ms=8, label='bernoulli pmf')\n",
    "\n",
    "ax.vlines(x1, 0, bernoulli.pmf(x1, p), colors='b', lw=5, alpha=0.5)\n",
    "\n",
    "ax.plot(x2, bernoulli.pmf(x2, p), 'bo', ms=8, label='bernoulli pmf')\n",
    "\n",
    "ax.vlines(x2, 0, bernoulli.pmf(x2, p), colors='b', lw=5, alpha=0.5)\n",
    "\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 二项分布(Binomial distribution)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "二项分布是多次伯努利分布实验的概率分布。\n",
    "\n",
    "以抛硬币举例，在抛硬币事件当中，每一次抛硬币的结果是独立的，并且每次抛硬币正面朝上的概率是恒定的，所以单次抛硬币符合伯努利分布。我们假设硬币正面朝上的概率是p，忽略中间朝上的情况，那么反面朝上的概率是q=(1-p)。我们重复抛n次硬币，其中有k项正面朝上的事件，就是二项分布"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "\n",
    "<div style=\"text-align: center;\">\n",
    "\n",
    "##### $$ b(k,n,p) = \\binom{k}{n} p^{k}(1-p)^{n-k} $$\n",
    "\n",
    "</div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAUm0lEQVR4nO3dcaydd33f8fcnNsGkd23T5EpDcYxN6lY1gyXs1smMSkkbwGmmGGlBcya2MDFZJETtFC1rWKtYc1WJ2hKrtiUBq0Si3VKTJlPlUaMoKmmnqjL4hgSowzyuXUpsIeE4DGYRJzV898d5vJ4cjnOf63vuOfc+fr+ko/M8v9/vOed7f/b53Oc+5znnSVUhSequSyZdgCR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Qb+Yi5VPtK6BY7i30jvGuhzsB/5lcybJDcB3q+pbky4qyd8/d1wyyWZ6/1+XPBya5/wU8LWq+vh5ho19ztrUNYk5SzKd5Ceb5TcA7wb+18Cwsb8m29Q1iddkVX20qtZW1Xp6OfH5qvrAwLCRzte8FwdfbmoRFytfBnX9apJb6V0o/UV67/gvuSR/SO9sjCuTHAd20ntjiqr6BHCA3lkkc8D3gX+1TOq6DbgzyVngJWD7GH5hQ2+P618AX22O7wL8e2BdX22TmLM2dU1izt4IfDrJKnq/WB6tqs9O+jXZsq6JvCaHWcr58isQJKnjVuKhG0nSAhj0ktRxBr0kdZxBL0kdZ9BLUscZ9JLUcQa9JHXc/wM1g9EEU6Vx4gAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(1, 1)\n",
    "n, p = 5, 0.4\n",
    "\n",
    "# 在参数n为5，p为0.4的情况下，伯努利分布的平均值m、方差v、峰度s和偏度k\n",
    "mean, var, skew, kurt = binom.stats(n, p, moments='mvsk')\n",
    "\n",
    "x = np.arange(binom.ppf(0.01, n, p),\n",
    "              binom.ppf(0.99, n, p))\n",
    "\n",
    "ax.plot(x, binom.pmf(x, n, p), 'bo', ms=8, label='binom pmf')\n",
    "\n",
    "ax.vlines(x, 0, binom.pmf(x, n, p), colors='b', lw=5, alpha=0.5)\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<div style=\"text-align: center;\">\n",
    "\n",
    "##### 二项分布(bonimial distribution)，当n取值不同时\n",
    "\n",
    "</div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 7,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 16 artists>"
      ]
     },
     "execution_count": 7,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image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v/h8vk7rG7jh17Qae3l2OuQe4pM+7IR+XIEkNaGrPXpJaZdhLUgMMe0lqgGEvSQ0w7CWpAYa9JDXAsJekBvwf98BF/+WSDTIAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# p=0.5,n=5\n",
    "p = 0.5\n",
    "k = np.linspace(0,5,6)\n",
    "n = 5\n",
    "\n",
    "prob = binom.pmf(k,n,p)\n",
    "\n",
    "plt.bar(k,prob,width=1,alpha=0.6)\n",
    "\n",
    "# p=0.5, n=10\n",
    "\n",
    "p = 0.5\n",
    "k = np.linspace(0,10,11)\n",
    "n = 10\n",
    "\n",
    "prob = binom.pmf(k,n,p)\n",
    "\n",
    "plt.bar(k,prob,width=1,alpha=0.6)\n",
    "\n",
    "# p=0.5, n=15\n",
    "\n",
    "p = 0.5\n",
    "k = np.linspace(0,15,16)\n",
    "n = 15\n",
    "\n",
    "prob = binom.pmf(k,n,p)\n",
    "\n",
    "plt.bar(k,prob,width=1,alpha=0.6)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<div style=\"text-align: center;\">\n",
    "\n",
    "##### 二项分布(bonimial distribution)，当p取值不同时\n",
    "\n",
    "</div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 11 artists>"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAQrElEQVR4nO3df6xfdX3H8efLFgQhc2Abs7VA6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6kngOuCVY+5pMXwryU8AdJ8fHGczh3rQD/N4h4NS95jojwF3V9VfjbufUaqqi6pqZVWtYuZ7dmNVNXNWWFXfBO5P8qJu6LU887HgB7P7gFckeU73M/paGnmheZbBx8KcB/zTGHs5MJ5eOS57e7zDmNsalVOB3wTuTHJHN/YnVbVtfC1pH/w+cFV3ArIT+K0x9zMSVXVLkmuB25i5M+x2DrDHBeyrJJ8AXg0sSzINXAK8D7gmyfnAN4DfGF+HPgJBkpp3qF+6kaTmGfSS1DiDXpIaZ9BLUuMMeklqnEEvSY0z6CWpcf8P9iBTQDYFbsgAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# p = 0.3, n=10\n",
    "p = 0.3\n",
    "k = np.linspace(0,10,11)\n",
    "n = 10\n",
    "\n",
    "prob = binom.pmf(k,n,p)\n",
    "\n",
    "plt.bar(k,prob,width=1,alpha=0.6)\n",
    "\n",
    "\n",
    "# # p = 0.4, n=10\n",
    "# p = 0.4\n",
    "# k = np.linspace(0,10,11)\n",
    "# n = 10\n",
    "\n",
    "# prob = binom.pmf(k,n,p)\n",
    "\n",
    "# plt.bar(k,prob,width=1,alpha=0.6)\n",
    "\n",
    "# p = 0.5, n=10\n",
    "p = 0.5\n",
    "k = np.linspace(0,10,11)\n",
    "n = 10\n",
    "\n",
    "prob = binom.pmf(k,n,p)\n",
    "\n",
    "plt.bar(k,prob,width=1,alpha=0.6)\n",
    "\n",
    "# # p = 0.6, n=10\n",
    "# p = 0.6\n",
    "# k = np.linspace(0,10,11)\n",
    "# n = 10\n",
    "\n",
    "# prob = binom.pmf(k,n,p)\n",
    "\n",
    "plt.bar(k,prob,width=1,alpha=0.6)\n",
    "p = 0.7\n",
    "k = np.linspace(0,10,11)\n",
    "n = 10\n",
    "\n",
    "prob = binom.pmf(k,n,p)\n",
    "\n",
    "plt.bar(k,prob,width=1,alpha=0.6)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 超几何分布\n",
    "\n",
    "例如在有$N$个样本，其中$K$个是不及格的。超几何分布描述了在该$N$个样本中抽出 $n$个，其中 $k$个是不及格的机率："
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<div style=\"text-align: center;\">\n",
    "\n",
    " $$ p(k,n,K,N)=\\frac{\\binom{K}{k}\\binom{N-K}{n-k} }{\\binom{N}{n} } $$\n",
    "\n",
    " $$ \\binom{n}{k} = \\frac{n!}{k!(n-k)!} $$\n",
    "\n",
    "</div>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "假设某医院接收到20位病人，其中7位病人患有心理健康问题。那么，如果我们想知道如果我们从20位病人中中随机选择12位，找到一定数量的患有精神健康问题的病人的概率。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 10,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAYgAAAEGCAYAAAB/+QKOAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAgUElEQVR4nO3dfZxcVZ3n8c83DQEbiCBpXSUPHTGoKJpgE4YB8YGnIC5hdlGCrRNn3WlRojgsq7BxUeMrirjDOs5EJQojqw0BQbTHjUZGgo8DpENCQoKRJuRRRiIgqI2EhN/8cU+bm8rt7uqkb1dX9/f9etWr7j33nlu/ququX917Tp2jiMDMzKzSmFoHYGZmw5MThJmZFXKCMDOzQk4QZmZWyAnCzMwKHVDrAAbL+PHjo7m5udZhmJnVlRUrVvw2IpqKto2YBNHc3ExnZ2etwzAzqyuSNvW2zZeYzMyskBOEmZkVcoIwM7NCThBmZlbICcLMzAo5QZjVofZ2aG6GMWOy+/b2WkdkI9GI6eZqNlq0t0NbG3R3Z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7NLe9iYH/T+XFmDq7YVk38lf7US1LJ28mebX+Vj1s59k2ZY+FUvnYv6Gf/c8iSxX8G5kk6jr7fw2rfmyhYHgP8RUou+eP2FV9/r52AD0XE0r4OYrv5DGKEiIhVkc1l8Cuyb/J3AmdFxLReksMvyNoHAFqBygbpIr8HDkvL48g+RJ+S9BKy4YaLrAdeniYNArggt20p8KE08iuSphc8zv66F3iTpPGp4fhCoOfb8W8kvVrSGOCvqjzez4F3pniPBY7rZb+fAudJakyDqf1VKvsN8GJJR0o6CKicKvSCdOxTgKdy3/bzx21N+xxD9m19PX37EfCBVKchnSUUSo/3ZK4H23uAH6fXaGJELAM+Rnbp6FB6fw8H4oLc/b+l5R+SDZpHOu60tJh//m8Gfhu75xmZpWxu8SPJLkUur3icpcAH0jD0SDqmjiYDqgmfQYwgkpqAJyPieUmvir7nf/4Q2axZ/5OsQbiaESsXAT+Q9OuIeIuklWSNz1vIPjj3EhHPSPpgqvdH9vyn/TTZzGir0wfQI2QfmMvYfdnisxFxM/soIh6VdHk6psguSX03bb6crK1hO9n16EOrOOSXyEZ9XUf23NcClR/iRDYX99fJEhTA1yJiJYCk+al8G3sPKf6n9LoeSNY2VPT4X5a0huxs5L0R8Ww/36wvARZJeh/ZN/kPAI/2sf8c4CupS3PPaKYNwDdTchHwxYj4naTe3sOBOELSarIzjgtT2YeBhan8ALLeeBeROiak8u4Ua4/VZO/zeODTEfHr3BcTyKZnbQbuSwltO3DeAGMdVTyaq5VO0qER8Yf0T7kQeCjqtCtmOgs5MCL+JOlo4F+BV0Y2p/n+Hvsu4LKI6NzfY9ULZZMetaR2g/05zifJOh38n8GIyzI+g7Ch8LeS5pB1YV0JXFvjePZHI7AsXaYQ8MHBSA5mw5HPIMzMrJAbqc3MrJAThJmZFXKCMDOzQk4QZmZWyAnCzMwK/QcIHDZPUhvHmAAAAABJRU5ErkJggg==",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "[M, n, N] = [20, 7, 12]\n",
    "\n",
    "rv = hypergeom(M, n, N)\n",
    "\n",
    "x = np.arange(0, n+1)\n",
    "\n",
    "pmf_target = rv.pmf(x)\n",
    "\n",
    "fig = plt.figure()\n",
    "\n",
    "ax = fig.add_subplot(111)\n",
    "\n",
    "ax.plot(x, pmf_target, 'bo')\n",
    "\n",
    "ax.vlines(x, 0, pmf_target, lw=2)\n",
    "\n",
    "ax.set_xlabel('# of target in our group of chosen people')\n",
    "\n",
    "ax.set_ylabel('hypergeom PMF')\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<div style=\"text-align: center;\">\n",
    "\n",
    "# 泊松分布\n",
    "\n",
    "</div>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<div style=\"text-align: center;\">\n",
    "\n",
    "# $$ f(k)=exp(-\\mu)\\frac{\\mu^k}{k!} $$\n",
    "\n",
    "\n",
    "</div>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "某神经元在一段时间内平均放电6次。我们想要知道在下一段同样的时间内，该神经元会放电多少次。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 11,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAXcklEQVR4nO3df3Ac533f8feHRCSYvrHswBdPQlIlQzHpQHXiOBCNII1qWrVD5YeYTqmEdBpLHWWYkmGTNDFSup0hZCbtWIRrJTMWOWYixYoUh9KQdoupkdAaqx3PZEyVkOzIgRjGAK2IoJ0IhGSlsOci0/r2j13Ux+ORWOAOd7gHn9fMze0+z3O33+NwPrfY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6A/PnFNtfTMAd9gySJ7NjtmYj4SLvrWWoR8YGIWBcRG8gm556MiKT39CLi74Dzkn4wb7qN7D7IKXsB6Je0Jv8/fhuJT0BXGQHuypfvAv5HG2tpCgd9434c+CWyPdsv5o+fandR1nT/HvgTSc8CbwP+a3vLWVr5Xy/HgWeAL5FlRVI/CwAg6U+BzwM/KGlK0j3Ah4B3S/oy2V82H2pnjc3gn0AwM0uc9+jNzBLnoDczS5yD3swscQ56M7PEOejNzBLnoDczS5yD3swscf8PzshdeRVH/NoAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(1, 1)\n",
    "mu = 6\n",
    "mean, var, skew, kurt = poisson.stats(mu, moments='mvsk')\n",
    "x = np.arange(poisson.ppf(0.01, mu),\n",
    "              poisson.ppf(0.99, mu))\n",
    "ax.plot(x, poisson.pmf(x, mu), 'bo', ms=8, label='poisson pmf')\n",
    "ax.vlines(x, 0, poisson.pmf(x, mu), colors='b', lw=5, alpha=0.5)\n",
    "\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 连续概率分布"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "#### 二项分布，当n-> $\\infty$\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'np' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[1;32m/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/2022NNU_Bayesian/Notebooks/Lecture3_pt2.ipynb Cell 31\u001b[0m in \u001b[0;36m<cell line: 2>\u001b[0;34m()\u001b[0m\n\u001b[1;32m      <a href='vscode-notebook-cell:/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/2022NNU_Bayesian/Notebooks/Lecture3_pt2.ipynb#X43sZmlsZQ%3D%3D?line=0'>1</a>\u001b[0m p \u001b[39m=\u001b[39m \u001b[39m0.5\u001b[39m\n\u001b[0;32m----> <a href='vscode-notebook-cell:/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/2022NNU_Bayesian/Notebooks/Lecture3_pt2.ipynb#X43sZmlsZQ%3D%3D?line=1'>2</a>\u001b[0m k \u001b[39m=\u001b[39m np\u001b[39m.\u001b[39mlinspace(\u001b[39m0\u001b[39m,\u001b[39m1000\u001b[39m,\u001b[39m1001\u001b[39m)\n\u001b[1;32m      <a href='vscode-notebook-cell:/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/2022NNU_Bayesian/Notebooks/Lecture3_pt2.ipynb#X43sZmlsZQ%3D%3D?line=2'>3</a>\u001b[0m n \u001b[39m=\u001b[39m \u001b[39m1000\u001b[39m\n\u001b[1;32m      <a href='vscode-notebook-cell:/Users/hcp4715/Library/CloudStorage/OneDrive-Personal/Teaching/2022NNU_Bayesian/Notebooks/Lecture3_pt2.ipynb#X43sZmlsZQ%3D%3D?line=4'>5</a>\u001b[0m prob \u001b[39m=\u001b[39m binom\u001b[39m.\u001b[39mpmf(k,n,p)\n",
      "\u001b[0;31mNameError\u001b[0m: name 'np' is not defined"
     ]
    }
   ],
   "source": [
    "p = 0.5\n",
    "k = np.linspace(0,1000,1001)\n",
    "n = 1000\n",
    "\n",
    "prob = binom.pmf(k,n,p)\n",
    "\n",
    "plt.bar(k,prob,width=1,alpha=0.6)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "当二项分布的参数你趋近于无穷大时，二项分布近似正态分布"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<div style=\"text-align: center;\">\n",
    "\n",
    "# 正态分布(Normal distribution)\n",
    "\n",
    "</div>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<div style=\"text-align: center;\">\n",
    "\n",
    "# $$ x \\sim N(\\mu, \\sigma^2) $$\n",
    "\n",
    "\n",
    "# $$ f(x) = \\frac{1}{\\sigma \\surd {2\\pi}}e^{-\\frac{(x-\\mu)^2}{2\\sigma^2}} $$\n",
    "\n",
    "</div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAA9fElEQVR4nO3deXyV5Zn/8c+VfSWEJIQEQjZCQlhkCWFfFFRc0brhrrWiVltnOl2cdsZ27LRja3+ddtS27lqLC2pVVFxQUXZIQLYEsockrCEr2U5ykvv3xznQSEFOSMJzzsn1fr3yMuc5z5N805KLm3sVYwxKKaW8l4/VAZRSSvUvLfRKKeXltNArpZSX00KvlFJeTgu9Ukp5OT+rA5wsOjraJCUlWR1DKaU8ytatW48aY2JO9Z7bFfqkpCRyc3OtjqGUUh5FRPad7j3tulFKKS+nhV4ppbycFnqllPJyWuiVUsrLaaFXSikv51KhF5FFIlIgIsUi8tA33HeNiBgRyep27d+dzxWIyMV9EVoppZTrzji9UkR8gSeBC4EqIEdEVhhj8k+6Lxx4ENjc7VomsAQYC8QDn4rIaGNMZ9/9CEq5qaNHoaAAysvh4EHo6HBcDw2FkSMhKQnGjIHAQCtTqgHAlXn02UCxMaYUQEReAxYD+Sfd90vgN8CPul1bDLxmjLEBZSJS7Px6G3sbXCm3ZAzs2AFffAF79gBQZ7Oxo6aGVrsdgNiQEMZFRhLg6wtBQTBtGsyfD/Hx1uVWXs2VQj8cqOz2ugqY1v0GEZkMJBhjPhCRH5307KaTnh1+8j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zO0xMiEgfEGWO2iUg4sBW4yoP+txcg1BjTJCL+wDrgQWPMpjM8+jXaoj9Lx4u8UyjgMX9jGmM+McbYnS834Vjf4DGMMXuMMe6+ero7V7YRcVvGmDU4ZtN5HGPMQWPMNufnx4A9nGJ1vrsyDk3Ol/7Ojx7XGi30vSAivxKRSuBm4GGr85ylbwMfWh3Cy51qGxGPKTbewrmr7iRgs8VRekREfEVkO3AEWGWM6XF+LfTfQEQ+FZHdp/hYDGCM+ZkxJgFYBjxgbdqvO1N25z0/w7G+YZl1SU/NlfxKuUpEwoC3gH856V/jbs8Y02mMmYjjX97ZItLj7jO32OvGXRljFrp46zJgJfDzfozTI2fKLiJ3AJcDC4wbDtT04H97T6BbgVjI2bf9FrDMGPN3q/OcLWNMvYisBhYBPRoY1xb9WRKRtG4vFwN7rcrSUyKyCPgxcKUxpsXqPAOAK9uIqH7gHMx8DthjjPm91Xl6SkRijs+KE5FgHAP6Pa41OuvmLInIW0A6jtkf+4B7jTEe0UpzblURiGPjOYBNnjJjCEBErgYeB2KAemC7McatTy8TkUuBP/CPbUR+ZW0i14nIq8B8HFvlHgZ+box5ztJQLhKR2cBaYBeO31WAnxpjVlqXynUiMgHHWR++OBrmy40xj/T462ihV0op76ZdN0op5eW00CullJfTQq+UUl5OC71SSnk5LfRKKeXltNArpZSX00KvlFJe7v8DRyQt7Ryp8HIAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(1, 1)\n",
    "mean, var, skew, kurt = norm.stats(moments='mvsk')\n",
    "\n",
    "x = np.linspace(norm.ppf(0.01),\n",
    "                norm.ppf(0.99), 100)\n",
    "ax.plot(x, norm.pdf(x),\n",
    "       'r-', lw=5, alpha=0.6, label='norm pdf')\n",
    "rv = norm()\n",
    "ax.plot(x, rv.pdf(x), 'k-', lw=2, label='frozen pdf')\n",
    "\n",
    "\n",
    "vals = norm.ppf([0.001, 0.5, 0.999])\n",
    "np.allclose([0.001, 0.5, 0.999], norm.cdf(vals))\n",
    "\n",
    "r = norm.rvs(size=1000)\n",
    "ax.hist(r, density=True, histtype='stepfilled', alpha=0.2)\n",
    "plt.show()"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<div style=\"text-align: center;\">\n",
    "\n",
    "# 正态分布(Normal distribution)，当$\\mu$不同时\n",
    "\n",
    "</div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 20,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 20 artists>"
      ]
     },
     "execution_count": 20,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAVs0lEQVR4nO3df4xdZ53f8fcnZm1WQGmyGcFim9jZNRVhqYDMGtHtUtpNgttt47QF4aUrBRXJzQoLCkLdpKzixigqPyS6q+IVsYql3RXUzW7S1VQ1yoYlbItCiMcQyNrgMnEIGQvIbJyQQhLHP779Y07ovZOx58zMnV9n3i9p5Ps853nu/Y5lf+bMuc99TqoKSVJ3XbTUBUiSFpZBL0kdZ9BLUscZ9JLUcQa9JHXci5a6gKkuvfTS2rRp01KXIUkryuHDh/+mqoamO7bsgn7Tpk2Mjo4udRmStKIkeeR8x7x0I0kdZ9BLUscZ9JLUcQa9JHWcQS9JHdcq6JNsS3IsyViSGy8w7l8mqSTDPX03NfOOJXn7IIqWJLU34/LKJGuAvcDVwDhwKMlIVR2dMu5lwAeAr/X0XQHsAF4HvAr4YpLXVNXZwX0LkqQLaXNGvxUYq6rjVfUccADYPs24jwIfB57t6dsOHKiqU1X1MDDW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pqo3A54BdS1ttv5lqb8Z8hMnPJ3xu6SqdXpv6pdlI8lLgDuDfTvmNfFmrqrNV9QYmf/PemmTRL58ti71uFkpVXdVy6OeAg8DuBSxnVmaqPcl7gH8K/EYtwzdaZvF3vxK4lccSa65v3wF8rqruXOp65qKqnkxyD7ANWNQ3xjt9Rn8hSbb0NLcD31mqWmaruRHMvwOuraqnl7qeVaDNNiBaIM0bmp8Fvl1Vn1rqemYjydDzq+KS/DyTb+gvetas5lU3dwB/h8nVH48AN1TVijhLa7aaWMfkxnEA962UFUMASf458J+BIeBJ4IGqevuSFjWDJP8E+H3+/zYgty5tRe0l+a/A25jcJvdHwO6q+uySFjULSf4+8L+BB5n8/wrw76vq4NJV1U6Svwv8EZP/bi4Cbq+qPYtex2oNeklaLVbtpRtJWi0MeknqOINekjrOoJekjjPoJanjDHpJ6jiDXpI67v8B/y/gEsqS6kcAAAAASUVORK5CYII=",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# mu = 0，sigma = 1\n",
    "x= np.linspace(-3,3,20)\n",
    "prob=norm.pdf(x,0,1)\n",
    "\n",
    "plt.bar(x,prob,width=0.4,alpha=0.6)\n",
    "\n",
    "# mu = 1，sigma = 1\n",
    "x= np.linspace(-3,3,20)\n",
    "prob=norm.pdf(x,1,1)\n",
    "\n",
    "plt.bar(x,prob,width=0.4,alpha=0.6)\n",
    "\n",
    "# mu = 2，sigma = 1\n",
    "x= np.linspace(-3,3,20)\n",
    "prob=norm.pdf(x,2,1)\n",
    "\n",
    "plt.bar(x,prob,width=0.4,alpha=0.6)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<div style=\"text-align: center;\">\n",
    "\n",
    "# 正态分布(Normal distribution)，当$\\sigma$不同时\n",
    "\n",
    "</div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 21,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<BarContainer object of 20 artists>"
      ]
     },
     "execution_count": 21,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXQAAAD4CAYAAAD8Zh1EAAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAARMUlEQVR4nO3de4ydeV3H8feHLkUFFMiOim2XFq2XKijuWCQYJAraVWm9oHajxo2XhsQqQlR2RRe2hMglAY02xgqbgAErApox1tQbxutCZ3FlaZfiWMDORtjCgtxcdrv79Y85C2fOzsx5ZubMnJ5f369kkvN7nt9znu+cmX7m199zS1UhSZp8Dxt3AZKk0TDQJakRBrokNcJAl6RGGOiS1IgrxrXjK6+8snbu3Dmu3UvSRLr11ls/WlVTS60bW6Dv3LmT2dnZce1ekiZSkg8tt84pF0lqhIEuSY0w0CWpEQa6JDXCQJekRhjoktQIA12SGmGgS1IjDHRJasTYrhSVNsINb799zdu+6wN3L2rv3fW4Nb/Xb/3wk9a8rbRWjtAlqREGuiQ1wkCXpEYY6JLUCANdkhphoEtSIwx0SWqEgS5JjTDQJakRBrokNcJAl6RGGOiS1IhOgZ5kX5KzSeaSXL/E+tcmua339f4knxh5pZKkFQ2922KSLcBR4NnAPHAqyUxVnXmwT1W9oK//LwJP2YBaJUkr6DJC3wvMVdW5qroXOA4cWKH/tcAfj6I4SVJ3XQJ9G3C+rz3fW/YQSZ4A7AL+fpn1h5LMJpm9cOHCamuVJK1g1AdFDwJvrar7l1pZVceqarqqpqempka8a0m6vHUJ9DuBHX3t7b1lSzmI0y2SNBZdAv0UsDvJriRbWQjtmcFOSb4eeCzwb6MtUZLUxdBAr6qLwGHgJHAH8JaqOp3kSJL9fV0PAserqjamVEnSSjo9JLqqTgAnBpbdONB+6ejKkiStlleKSlIjDHRJaoSBLkmN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XVmxQ0vEUmeAXwaeGNVfdO461mNJI8HHl9V707yaOBW4Acn6LMP8Miq+nSShwP/DDy/qm7ZzDqaH6E/GOY9jwQm5i9YVf11VV3sNW9h4RqAiVFVd1TVRl8NPEqfv81FVd0LPHibi4lQVf/IwllmE6eq/qeq3t17/SngDmDbeKvqrhZ8utd8eO9r07Om+UAHSPLyJOeBnwBuHHc9a/QzwF+Nu4jGbQPO97XnmaBQaUWSncBTgHeOuZRVSbIlyW3AXcDfVNWm199EoCf52yTvXeLrAEBVvbiqdgBvAg6v/G6ba1jtvT4vBi6yUP8lpUv9UldJHgW8Dfjlgf9dX/Kq6v6q+hYW/ie9N8mmT3s18YCLqnpWx65vAk4AL9nAclZlWO1JrgN+APjuS/Hq21V89pOgy20utEF6c89vA95UVW8fdz1rVVWfSPIOYB+wqQeomxihryTJ7r7mAeB946pltXoPFvk1YH9VfXbc9VwGutzmQhugd1Dx9cAdVfWacdezWkmmHjwLLckXs3BgfdOz5nI4y+VtLNyq9wHgQ8DzqmoiRl29Wyk8gi/c6OyWSTlDByDJDwG/C0wBnwBuq6rvHWtRQyT5PuC3+cJtLl4+3oq6S/LHwDNZuIXrR4CXVNXrx1pUR0m+A/gn4HYW/q0C/HpVnRhfVd0leTLwBhZ+bx4GvKWqjmx6Ha0HuiRdLpqfcpGky4WBLkmNMNAlqREGuiQ1wkCXpEYY6JLUCANdkhrx/9h1HYvVBWZkAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "# mu = 0，sigma = 0.5\n",
    "x= np.linspace(-3,3,20)\n",
    "prob=norm.pdf(x,0,0.5)\n",
    "\n",
    "plt.bar(x,prob,width=0.4,alpha=0.6)\n",
    "\n",
    "# mu = 0，sigma = 1\n",
    "x= np.linspace(-3,3,20)\n",
    "prob=norm.pdf(x,0,1)\n",
    "\n",
    "plt.bar(x,prob,width=0.4,alpha=0.6)\n",
    "\n",
    "# mu = 0，sigma = 2\n",
    "x= np.linspace(-3,3,20)\n",
    "prob=norm.pdf(x,0,2)\n",
    "\n",
    "plt.bar(x,prob,width=0.4,alpha=0.6)"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<div style=\"text-align: center;\">\n",
    "\n",
    "# t分布\n",
    "\n",
    "</div>"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "<div style=\"text-align: center;\">\n",
    "\n",
    "# $$ f(x,v)=\\frac{\\Gamma ((v+1)/2)}{\\sqrt{\\pi v}\\gamma(v/2) }(1+x^2/v) ^{-(v+1)/2} $$\n",
    "\n",
    "</div>"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXoAAAD4CAYAAADiry33AAAAOXRFWHRTb2Z0d2FyZQBNYXRwbG90bGliIHZlcnNpb24zLjQuMywgaHR0cHM6Ly9tYXRwbG90bGliLm9yZy/MnkTPAAAACXBIWXMAAAsTAAALEwEAmpwYAAAo70lEQVR4nO3de5RUZ5nv8e/T3dA3biGQmARCN9DcSSA0xFyNShQmMclRRxPNmCw94o01evTMmXic5ZyVWa5xzBlnZi2Jymhm1DGSjDmzxJEkJpOLxtxooAM0dwgJkAQId5q+13P+qCJW1d5NV3dX167L77MWy65n7+p+6Mivd7/73e9r7o6IiBSvsqgbEBGRoaWgFxEpcgp6EZEip6AXESlyCnoRkSJXEXUD6caNG+d1dXVRtyEiUlDWrVv3truPDzuWd0FfV1dHU1NT1G2IiBQUM3utt2MauhERKXIKehGRIqegFxEpcgp6EZEip6AXESlyCnoRkSKnoBcRKXIKehGRIqegFxHJguPHj3P//fcP6nM888wz3HzzzQB0dHSwePFi5s2bx0MPPTSoz5t3T8aK5LNN+09E8nXnThgdydeVzJ0N+i9+8YtZ+XwbNmwAoLm5edCfS0EvIsXlc58b+q/xwx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oGvufss4N3Al0rwe5Dsy8DWqJtIpqDPnn8A/hdQkne33f237t6dePki8WcmSsE7S4S4eydwdomQkuHub7r7+sTHp4iHXOAJ+FJgZhOAm4AfRd1LMgV9FpjZrcABd38l6l7yxKeBR6NuIkfClggpyZADSKxcOx94KeJWovKPxC/4YhH3kSIvlkAoBGb2JPCukEPfAP438WGbonau74G7/ypxzjeI/yr/81z2JtEzsxHAI8BX3P1k1P3kmpndDBxy93VmdkPE7aRQ0GfI3ReH1c1sLlAPvBJfsJMJwHozW+Tub+WwxSHX2/fgLDO7G7gZeL+XzgMaWuYDMLNhxEP+5+7+/6LuJyLXALeY2Z8AVcAoM/s3d78z4r70wFS2mdleoNHdS2oFPzNbAnwXeI+7H466n1xJrO20A3g/8YBfC3zC3VsibSyHEkuS/wQ46u5fibidvJC4ov+f7n5zxK0AGqOX7PkeMBJ4wsyazewHUTeUC4kb0GeXCNkKPFxKIZ9wDfBnwPsS/+2bE1e1kid0RS8iUuR0RS8iUuQU9CIiRU5BLyJS5BT0IiJFTkEvIlLkFPQiIkVOQS8iUuT+P7IqqawxZf5NAAAAAElFTkSuQmCC",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "fig, ax = plt.subplots(1, 1)\n",
    "\n",
    "df = 30\n",
    "\n",
    "# 在参数为0.3的情况下，伯努利分布的平均值m、方差v、峰度s和偏度k\n",
    "mean, var, skew, kurt = t.stats(df, moments='mvsk')\n",
    "\n",
    "\n",
    "x = np.linspace(t.ppf(0.01, df),\n",
    "                t.ppf(0.99, df), 100)\n",
    "\n",
    "ax.plot(x, t.pdf(x, df),\n",
    "       'r-', lw=5, alpha=0.6, label='t pdf')\n",
    "\n",
    "\n",
    "vals = t.ppf([0.001, 0.5, 0.999], df)\n",
    "np.allclose([0.001, 0.5, 0.999], t.cdf(vals, df))\n",
    "\n",
    "r = t.rvs(df, size=1000)\n",
    "ax.hist(r, density=True, histtype='stepfilled', alpha=0.2)\n",
    "ax.legend(loc='best', frameon=False)\n",
    "plt.show()\n"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3.8.9 64-bit",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.9"
  },
  "orig_nbformat": 4,
  "vscode": {
   "interpreter": {
    "hash": "31f2aee4e71d21fbe5cf8b01ff0e069b9275f58929596ceb00d14d90e3e16cd6"
   }
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
